# uncompyle6 version 3.2.3
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.8 |Anaconda custom (64-bit)| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: helpers\mailer\sender\base.py
__author__ = "Attila Gerendi (Sanyi)"
from typing import Union, List
from threading import Lock


class Sender:
    def __init__(self, settings):
        self._settings = settings
        self.lock = Lock()

    @property
    def settings(self):
        with self.lock:
            if callable(self._settings):
                return self._settings()
            return self._settings

    def can_send(self):
        return self.settings is not None

    def reload_settings(self, settings):
        with self.lock:
            self._settings = settings

    def send(
        self,
        destination,
        from_address,
        subject,
        body_html=None,
        body_txt=None,
        timeout=0,
    ):
        raise NotImplementedError()
